
package com.project.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;
@Configuration

public class FilterConfig {
    @Bean
    public FilterRegistrationBean<MyLoginFilter> timeFilter1(){
        FilterRegistrationBean<MyLoginFilter> registrationBean = new FilterRegistrationBean<MyLoginFilter>();
        registrationBean.setFilter(new MyLoginFilter());
        List<String> urlPatters = new ArrayList<String>();
        urlPatters.add("/*");
        registrationBean.setUrlPatterns(urlPatters);
        registrationBean.setOrder(1);
        return registrationBean;
    }
}

